using System;
using System.Diagnostics;
using System.Windows;
using System.Windows.Controls;
namespace MicroMsg.UI.UserContrl
{
	public class LogItem : UserControl
	{
		public static DependencyProperty ListItemProperty = DependencyProperty.Register("ItemObject", typeof(string), typeof(LogItem), new PropertyMetadata(null, new PropertyChangedCallback(LogItem.OnItemPropertyChanged)));
		internal Grid LayoutRoot;
		internal TextBlock txtLog;
		private bool _contentLoaded;
		public string ItemObject
		{
			get
			{
				return (string)base.GetValue(LogItem.ListItemProperty);
			}
			set
			{
				base.SetValue(LogItem.ListItemProperty, value);
			}
		}
		public LogItem()
		{
			this.InitializeComponent();
		}
		private static void OnItemPropertyChanged(DependencyObject dependencyObject_0, DependencyPropertyChangedEventArgs dependencyPropertyChangedEventArgs_0)
		{
			if (dependencyPropertyChangedEventArgs_0.get_Property() == LogItem.ListItemProperty)
			{
				(dependencyObject_0 as LogItem).OnListItemPropertyChanged(dependencyPropertyChangedEventArgs_0);
			}
		}
		private void OnListItemPropertyChanged(DependencyPropertyChangedEventArgs dependencyPropertyChangedEventArgs_0)
		{
			try
			{
				this.RefreshItem(dependencyPropertyChangedEventArgs_0.get_NewValue() as string);
			}
			catch (Exception ex)
			{
				ex.ToString();
			}
		}
		private void RefreshItem(string item)
		{
			if (item == null)
			{
				return;
			}
			this.txtLog.set_Text(item);
		}
		[DebuggerNonUserCode]
		public void InitializeComponent()
		{
			if (this._contentLoaded)
			{
				return;
			}
			this._contentLoaded = true;
			Application.LoadComponent(this, new Uri("/MicroMsg;component/Source/UI/LogView/LogItem.xaml", 2));
			this.LayoutRoot = (Grid)base.FindName("LayoutRoot");
			this.txtLog = (TextBlock)base.FindName("txtLog");
		}
	}
}
